package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.StudentFacesTwo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

public interface StudentFacesTwoRepository extends JpaRepository<StudentFacesTwo,Integer> {

    @Query(value = "select s.id,s.student_name,sft.url,sft.id student_faces_id from student s left join student_faces_two sft on(s.id=sft.student_id) where s.class_id = ?1",nativeQuery = true)
    List<Map<String, Object>> findbyClassId(Integer classid);

    StudentFacesTwo findByStudentId(Integer studentId);
}
